<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"
	contentType="text/html; charset=UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>${name}刷脸记录查询</title>
<link rel="stylesheet" type="text/css"
	href="<%=path%>/jquery-easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css"
	href="<%=path%>/jquery-easyui/themes/icon.css">
<style type="text/css">
</style>
<script type="text/javascript"
	src="<%=path%>/jquery-easyui/jquery-1.8.0.js"></script>
<script type="text/javascript"
	src="<%=path%>/jquery-easyui/jquery.easyui.min.js"></script>
<script type="text/javascript"
	src="<%=path%>/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path%>/js/jquery.json-2.4.js"></script>
<script type="text/javascript" src="<%=path%>/js/post.js"></script>
<script type="text/javascript" src="<%=path%>/js/util.js"></script>
<script type="text/javascript">
	var path = '${pageContext.request.contextPath}';

	function loadGird(){
		var key=$('#searchKey').val();
		var grid = $('#grid');
		grid.datagrid('load', { 
			id : '${code}',
			name : key,
			startDate: $('#selectStartDate').datebox('getValue'),
			endDate: $('#selectEndDate').datebox('getValue')
		});
	}

	$(function () {
		var date = new Date();
		date.setDate(1);
		$('#selectStartDate').datebox('setValue', date.getFullYear()+'-'+(date.getMonth()+1)+'-'+date.getDate());
		date.setMonth(date.getMonth() + 1);
		date.setDate(date.getDate() - 1);
		$('#selectEndDate').datebox('setValue', date.getFullYear()+'-'+(date.getMonth()+1)+'-'+date.getDate());
	
		loadGird();
	});
</script>
</head>
<body class="easyui-layout">
	<!-- 工具栏 -->
	<div id="tb" style="height:auto">
		时间从： <input id="selectStartDate" class="easyui-datebox"
			data-options="onSelect:loadGird" /> 到： <input id="selectEndDate"
			class="easyui-datebox" data-options="onSelect:loadGird" /> 检索条件: <input
			class="easyui-validatebox" type="text" id="searchKey"
			onchange="loadGird()" />

	</div>


	<div data-options="region:'center'">
		<table id="grid" class="easyui-datagrid"
			data-options="
			sortOrder:'asc',
			sortName:'date',
			remoteSort:true,
			idField:'id',
			fit:true,
			singleSelect:true,
			collapsible:true,
			url:'<%=path%>/card/loadAll/',
			toolbar:'#tb',
			striped: true,
			pageSize:20,
			pagination:true,
			fitColumns:false,
			rownumbers:true
			">
			<thead>
				<tr>
					<th data-options="field:'employeeCode',width:70,sortable:false">工号</th>
					<th data-options="field:'employeeName',width:60,sortable:false">姓名</th>
					<th data-options="field:'date',width:120,sortable:true">日期</th>
				</tr>
			</thead>
		</table>

	</div>
</body>
</html>